<?php if(!defined('A')) exit;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<?php
loadjs(array('common','jquery'),P_JS);
loadcss(array('dig'));
?>
<script>
$(document).ready(function(){
	
});
</script>
</head>
<body>

<div class="newdigg" id="newdigg"></div>


<script language="javascript" type="text/javascript">
$(document).ready(function(){
		var aid='7';
		$.post('<?php echo url('arc','dig_data');?>',{'id':aid},function(data){
			if(data){
				$('#newdigg').html(data);	
			}	
		},'html');
});
function postDigg(ftype,aid){
	var taget_obj = $('#newdigg');
	var saveid = get_cookie('diggid');
	if(saveid != null){
		var saveids = saveid.split(',');
		var hasid = false;
		saveid = '';
		j = 1;
		for(i=saveids.length-1;i>=0;i--){
			if(saveids[i]==aid && hasid) {
				continue;
			}else {
				if(saveids[i]==aid && !hasid) {
					hasid = true;
				}
				saveid += (saveid=='' ? saveids[i] : ','+saveids[i]);
				j++;
				if(j==20 && hasid) break;
				if(j==19 && !hasid) break;
			}
		}
		if(hasid) { 
			alert("您已经顶过该帖，请不要重复顶帖 ！"); return;
		}else{ 
			saveid += ','+aid;
		}
		set_cookie('diggid',saveid,7);
	}else{
		set_cookie('diggid',aid,7);
	}
	if(ftype=='good'){
		var u='<?php echo url('arc','dig_good');?>';	
	}else{
		var u='<?php echo url('arc','dig_bad');?>';
	}
	$.post(u,{'id':aid},function(data){
		if(data){
			$('#newdigg').html(data);	
		}	
	},'html');
}
</script>


</body>
</html>